# -*- coding=utf-8 -*-  
import datetime  
import time
def dateRange(beginDate, endDate):  
    dates = []  
    dt = datetime.datetime.strptime(beginDate, "%Y%m%d")  
    date = beginDate[:]  
    while date <= endDate:  
        dates.append(date)  
        dt = dt + datetime.timedelta(1)  
        date = dt.strftime("%Y%m%d")  
    return dates
def hotDateRange(beginDate, endDate):
    date_list = []
    begin_date = datetime.datetime.strptime(beginDate, "%Y-%m-%d")
    end_date = datetime.datetime.strptime(endDate, "%Y-%m-%d")
    while begin_date <= end_date:
        date_str = begin_date.strftime("%m-%d")
        date_list.append(date_str)
        begin_date += datetime.timedelta(days=1)
    return date_list
def StringToDate(date):
	a=time.strptime(date,'%Y%m%d')
	y,m,d = a[0:3]
	x=datetime.datetime(y,m,d)
	return x
def convertStringType(str):
	return str.split("-")[0]+str.split("-")[1]+str.split("-")[2]

def getFutureOneWeek(max):
    newDays = []
    maxDay = time.strptime(max, '%Y%m%d')
    today = datetime.date.today().strftime("%Y%m%d")
    today = time.strptime(today, "%Y%m%d")
    maxDay = datetime.datetime(maxDay[0], maxDay[1], maxDay[2])
    today = datetime.datetime(today[0], today[1], today[2])
    predDayNum=(today-maxDay).days+7
    # now = datetime.datetime.now()
    # newDays.append([int(today.strftime("%Y%m%d"))])
    for i in range(predDayNum):
        t = maxDay + datetime.timedelta(days=i + 1)
        newDays.append([int(t.strftime("%Y%m%d"))])
    return newDays

# if __name__ == '__main__':
    # newDays=[]
    # today = datetime.date.today()
    # t = today + datetime.timedelta(days=-7)
    # print t
    # # now = datetime.datetime.now()
    # newDays.append(today.strftime("%Y%m%d"))
    # for i in range(7):
    #     t=today + datetime.timedelta(days=i + 1)
    #     newDays.append(t.strftime("%Y%m%d"))
    # print newDays
    # print getFutureOneWeek()